lib/repo: Separate min-free-space-* calculation from transaction codepath
authorUmang Jain <umang@endlessm.com>
Thu, 13 Sep 2018 19:37:32 +0000 (01:07 +0530)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 21 Sep 2018 15:09:12 +0000 (15:09 +0000)
commita0937b6cf03996416c338b996a87677d6b65da14
tree6d0e72ff0f0cc24d5e7b3a96e43d6c3ecdb76586
parentfc84fb402c397213108710e17ddf88108f0ae2cb
lib/repo: Separate min-free-space-* calculation from transaction codepath

Earlier, the actual reserved space (in blocks) were calculated inside the
transaction codepath ostree_repo_prepare_transaction(). However, while
reworking on ostree_repo_get_min_free_space_bytes() API, it was realized that
this calculation can be done independently from the transaction's codepaths, hence
enabling the usage for ostree_repo_get_min_free_space_bytes() API irrespective
of whether there is an ongoing transaction or not.

https://github.com/ostreedev/ostree/issues/1720

Closes: #1722
Approved by: pwithnall
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo.c
src/libostree/ostree-repo.h